package com.leadingsoft.pwxk.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.pwxk.converter.ManaRecordInfoConverter;
import com.leadingsoft.pwxk.dto.ManaRecordInfoDto;
import com.leadingsoft.pwxk.model.ManaRecordInfo;
import com.leadingsoft.pwxk.service.ManaRecordInfoService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 
 * @author ysh
 *
 */
@Api(description = "环境管理台账记录要求信息相关")
@RestController
@RequestMapping("api/manaRecordInfo")
public class ManaRecordInfoController {
	@Autowired
	ManaRecordInfoService manaRecordInfoService;

	@Autowired
	ManaRecordInfoConverter manaRecordInfoConverter;

	@ApiOperation("环境管理台账记录要求信息列表")
	@GetMapping(path = "{dataId}")
	@ResponseStatus(code = HttpStatus.OK)
	public List<ManaRecordInfoDto> getList(@PathVariable(value = "dataId") String dataId) {
		List<ManaRecordInfo> list = manaRecordInfoService.getList(dataId);
		return manaRecordInfoConverter.toListDto(list);
	}

}